Affine intra block copy refinement

ABSTRACT

An encoder may generate, for each of a plurality of block vectors, an intra block compensated prediction of a block. The encoder may select, based on the intra block compensated predictions of the block, a block vector from the plurality of block vectors for the block. The encoder may determine affine transform parameters of the intra block compensated prediction for the block vector. The encoder may signal, in a bit stream, both of an indication of an affine transform of the intra block compensated prediction and the affine transform parameters based on a residual determined for the intra block compensated prediction generated for the block vector and a value of the affine transform parameters.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application claims the benefit of U.S. Provisional Application No.63/082,711, filed Sep. 24, 2020, which is hereby incorporated byreference in its entirety.

BRIEF DESCRIPTION OF THE DRAWINGS

Examples of several of the various embodiments of the present disclosureare described herein with reference to the drawings.

FIG. 1 illustrates an exemplary video coding/decoding system in whichembodiments of the present disclosure may be implemented.

FIG. 2 illustrates an exemplary encoder in which embodiments of thepresent disclosure may be implemented.

FIG. 3 illustrates an exemplary decoder in which embodiments of thepresent disclosure may be implemented.

FIG. 4 illustrates an example quadtree partitioning of a coding treeblock (CTB) in accordance with embodiments of the present disclosure.

FIG. 5 illustrates a corresponding quadtree of the example quadtreepartitioning of the CTB in FIG. 4 in accordance with embodiments of thepresent disclosure.

FIG. 6 illustrates example binary and ternary tree partitions inaccordance with embodiments of the present disclosure.

FIG. 7 illustrates an example quadtree+multi-type tree partitioning of aCTB in accordance with embodiments of the present disclosure.

FIG. 8 illustrates a corresponding quadtree+multi-type tree of theexample quadtree+multi-type tree partitioning of the CTB in FIG. 7 inaccordance with embodiments of the present disclosure.

FIG. 9 illustrates an example set of reference samples determined forintra prediction of a current block being encoded or decoded inaccordance with embodiments of the present disclosure.

FIG. 10A illustrates the 35 intra prediction modes supported by HEVC inaccordance with embodiments of the present disclosure.

FIG. 10B illustrates the 67 intra prediction modes supported by HEVC inaccordance with embodiments of the present disclosure.

FIG. 11 illustrates the current block and reference samples from FIG. 9in a two-dimensional x, y plane in accordance with embodiments of thepresent disclosure.

FIG. 12 illustrates an example angular mode prediction of the currentblock from FIG. 9 in accordance with embodiments of the presentdisclosure.

FIG. 13A illustrates an example of inter prediction performed for acurrent block in a current picture being encoded in accordance withembodiments of the present disclosure.

FIG. 13B illustrates an example horizontal component and verticalcomponent of a motion vector in accordance with embodiments of thepresent disclosure.

FIG. 14 illustrates an example of bi-prediction, performed for a currentblock in accordance with embodiments of the present disclosure.

FIG. 15A illustrates an example location of five spatial candidateneighboring blocks relative to a current block being coded in accordancewith embodiments of the present disclosure.

FIG. 15B illustrates an example location of two temporal, co-locatedblocks relative to a current block being coded in accordance withembodiments of the present disclosure.

FIG. 16 illustrates an example of IBC applied for screen content inaccordance with embodiments of the present disclosure.

FIG. 17 illustrates an example of IBC prediction technique for a currentblock in IBC search range in accordance with embodiments of the presentdisclosure.

FIG. 18 illustrates an example of IBC applied for screen content with acombination of ‘italic’ and ‘non-italic’ letters in accordance withembodiments of the present disclosure.

FIG. 19 illustrates an example of IBC prediction technique with affinetransformation for a current block in IBC search range in accordancewith embodiments of the present disclosure.

FIG. 20 illustrates an example relationship between a selectedprediction sample of a reference block and affine transformation on thatblock in accordance with embodiments of the present disclosure.

FIG. 21 illustrates an example of a four-parameter affine model withrotation, scaling, and translation for a current block in accordancewith embodiments of the present disclosure.

FIG. 22 illustrates an example of a general flow chart on settingAffine_IBC_Flag in accordance with embodiments of the presentdisclosure.

FIG. 23 illustrates an example of a flow chart on settingAffine_IBC_Flag with residual checking in accordance with embodiments ofthe present disclosure.

FIG. 24 illustrates an example of a encoding process for affinerefinement-based IBC prediction in accordance with embodiments of thepresent disclosure.

FIG. 25 illustrates an example of a decoding process for affinerefinement-based IBC prediction in accordance with embodiments of thepresent disclosure.

FIG. 26 illustrates an example of pixel and sub-pixel level precision ofIBC prediction technique with affine transformation for a current blockin IBC search range in accordance with embodiments of the presentdisclosure.

FIG. 27 illustrates an example of luminance and chrominance samples ofIBC prediction technique with affine transformation for a current blockin IBC search range in accordance with embodiments of the presentdisclosure.

FIG. 28 illustrates a block diagram of an example computer system inwhich embodiments of the present disclosure may be implemented.

DETAILED DESCRIPTION

In the following description, numerous specific details are set forth inorder to provide a thorough understanding of the disclosure. However, itwill be apparent to those skilled in the art that the disclosure,including structures, systems, and methods, may be practiced withoutthese specific details. The description and representation herein arethe common means used by those experienced or skilled in the art to mosteffectively convey the substance of their work to others skilled in theart. In other instances, well-known methods, procedures, components, andcircuitry have not been described in detail to avoid unnecessarilyobscuring aspects of the disclosure.

References in the specification to “one embodiment,” “an embodiment,”“an example embodiment,” etc., indicate that the embodiment describedmay include a particular feature, structure, or characteristic, butevery embodiment may not necessarily include the particular feature,structure, or characteristic. Moreover, such phrases are not necessarilyreferring to the same embodiment. Further, when a particular feature,structure, or characteristic is described in connection with anembodiment, it is submitted that it is within the knowledge of oneskilled in the art to affect such feature, structure, or characteristicin connection with other embodiments whether or not explicitlydescribed.

Also, it is noted that individual embodiments may be described as aprocess which is depicted as a flowchart, a flow diagram, a data flowdiagram, a structure diagram, or a block diagram. Although a flowchartmay describe the operations as a sequential process, many of theoperations can be performed in parallel or concurrently. In addition,the order of the operations may be re-arranged. A process is terminatedwhen its operations are completed, but could have additional steps notincluded in a figure. A process may correspond to a method, a function,a procedure, a subroutine, a subprogram, etc. When a process correspondsto a function, its termination can correspond to a return of thefunction to the calling function or the main function.

The term “computer-readable medium” includes, but is not limited to,portable or non-portable storage devices, optical storage devices, andvarious other mediums capable of storing, containing, or carryinginstruction(s) and/or data. A computer-readable medium may include anon-transitory medium in which data can be stored and that does notinclude carrier waves and/or transitory electronic signals propagatingwirelessly or over wired connections. Examples of a non-transitorymedium may include, but are not limited to, a magnetic disk or tape,optical storage media such as compact disk (CD) or digital versatiledisk (DVD), flash memory, memory or memory devices. A computer-readablemedium may have stored thereon code and/or machine-executableinstructions that may represent a procedure, a function, a subprogram, aprogram, a routine, a subroutine, a module, a software package, a class,or any combination of instructions, data structures, or programstatements. A code segment may be coupled to another code segment or ahardware circuit by passing and/or receiving information, data,arguments, parameters, or memory contents. Information, arguments,parameters, data, etc. may be passed, forwarded, or transmitted via anysuitable means including memory sharing, message passing, token passing,network transmission, or the like.

Furthermore, embodiments may be implemented by hardware, software,firmware, middleware, microcode, hardware description languages, or anycombination thereof. When implemented in software, firmware, middlewareor microcode, the program code or code segments to perform the necessarytasks (e.g., a computer-program product) may be stored in acomputer-readable or machine-readable medium. A processor(s) may performthe necessary tasks.

Representing a video sequence in digital form may require a large numberof bits. The data size of a video sequence in digital form may be toolarge for storage and/or transmission in many applications. Videoencoding may be used to compress the size of a video sequence to providefor more efficient storage and/or transmission. Video decoding may beused to decompress a compressed video sequence for display and/or otherforms of consumption.

FIG. 1 illustrates an exemplary video coding/decoding system 100 inwhich embodiments of the present disclosure may be implemented. Videocoding/decoding system 100 comprises a source device 102, a transmissionmedium 104, and a destination device 106. Source device 102 encodes avideo sequence 108 into a bitstream 110 for more efficient storageand/or transmission. Source device 102 may store and/or transmitbitstream 110 to destination device 106 via transmission medium 104.Destination device 106 decodes bitstream 110 to display video sequence108. Destination device 106 may receive encoded bit stream 110 fromsource device 102 via transmission medium 104. Source device 102 anddestination device 106 may be any one of a number of different devices,including a desktop computer, laptop computer, tablet computer, smartphone, wearable device, television, camera, video gaming console,set-top box, or video streaming device.

To encode video sequence 108 into bitstream 110, source device 102 maycomprise a video source 112, an encoder 114, and an output interface116. Video source 112 may provide or generate video sequence 108 from acapture of a natural scene and/or a synthetically generated scene. Asynthetically generated scene may be a scene comprising computergenerated graphics or screen content. Video source 112 may comprise avideo capture device (e.g., a video camera), a video archive comprisingpreviously captured natural scenes and/or synthetically generatedscenes, a video feed interface to receive captured natural scenes and/orsynthetically generated scenes from a video content provider, and/or aprocessor to generate synthetic scenes.

A shown in FIG. 1 , a video sequence, such as video sequence 108, maycomprise a series of pictures (also referred to as frames). A videosequence may achieve the impression of motion when a constant orvariable time is used to successively present pictures of the videosequence. A picture may comprise one or more sample arrays of intensityvalues. The intensity values may be taken at a series of regularlyspaced locations within a picture. A color picture typically comprises aluminance sample array and two chrominance sample arrays. The luminancesample array may comprise intensity values representing the brightness(or luma component, Y) of a picture. The chrominance sample arrays maycomprise intensity values that respectively represent the blue and redcomponents of a picture (or chroma components, Cb and Cr) separate fromthe brightness. Other color picture sample arrays are possible based ondifferent color schemes (e.g., an RGB color scheme). For color pictures,a pixel may refer to all three intensity values for a given location inthe three sample arrays used to represent color pictures. A monochromepicture comprises a single, luminance sample array. For monochromepictures, a pixel may refer to the intensity value at a given locationin the single, luminance sample array used to represent monochromepictures.

Encoder 114 may encode video sequence 108 into bitstream 110. To encodevideo sequence 108, encoder 114 may apply one or more predictiontechniques to reduce redundant information in video sequence 108.Redundant information is information that may be predicted at a decoderand therefore may not be needed to be transmitted to the decoder foraccurate decoding of the video sequence. For example, encoder 114 mayapply spatial prediction (e.g., intra-frame or intra prediction),temporal prediction (e.g., inter-frame prediction or inter prediction),inter-layer prediction, and/or other prediction techniques to reduceredundant information in video sequence 108. Before applying the one ormore prediction techniques, encoder 114 may partition pictures of videosequence 108 into rectangular regions referred to as blocks. Encoder 114may then encode a block using one or more of the prediction techniques.

For temporal prediction, encoder 114 may search for a block similar tothe block being encoded in another picture (also referred to as areference picture) of video sequence 108. The block determined duringthe search (also referred to as a prediction block) may then be used topredict the block being encoded. For spatial prediction, encoder 114 mayform a prediction block based on data from reconstructed neighboringsamples of the block to be encoded within the same picture of videosequence 108. A reconstructed sample refers to a sample that was encodedand then decoded. Encoder 114 may determine a prediction error (alsoreferred to as a residual) based on the difference between a block beingencoded and a prediction block. The prediction error may representnon-redundant information that may be transmitted to a decoder foraccurate decoding of a video sequence.

Encoder 114 may apply a transform to the prediction error (e.g. adiscrete cosine transform (DCT)) to generate transform coefficients.Encoder 114 may form bitstream 110 based on the transform coefficientsand other information used to determine prediction blocks (e.g.,prediction types, motion vectors, and prediction modes). In someexamples, encoder 114 may perform one or more of quantization andentropy coding of the transform coefficients and/or the otherinformation used to determine prediction blocks before forming bitstream110 to further reduce the number of bits needed to store and/or transmitvideo sequence 108.

Output interface 116 may be configured to write and/or store bitstream110 onto transmission medium 104 for transmission to destination device106. In addition or alternatively, output interface 116 may beconfigured to transmit, upload, and/or stream bitstream 110 todestination device 106 via transmission medium 104. Output interface 116may comprise a wired and/or wireless transmitter configured to transmit,upload, and/or stream bitstream 110 according to one or more proprietaryand/or standardized communication protocols, such as Digital VideoBroadcasting (DVB) standards, Advanced Television Systems Committee(ATSC) standards, Integrated Services Digital Broadcasting (ISDB)standards, Data Over Cable Service Interface Specification (DOCSIS)standards, 3rd Generation Partnership Project (3GPP) standards,Institute of Electrical and Electronics Engineers (IEEE) standards,Internet Protocol (IP) standards, and Wireless Application Protocol(WAP) standards.

Transmission medium 104 may comprise a wireless, wired, and/or computerreadable medium. For example, transmission medium 104 may comprise oneor more wires, cables, air interfaces, optical discs, flash memory,and/or magnetic memory. In addition or alternatively, transmissionmedium 104 may comprise one more networks (e.g., the Internet) or fileservers configured to store and/or transmit encoded video data.

To decode bitstream 110 into video sequence 108 for display, destinationdevice 106 may comprise an input interface 118, a decoder 120, and avideo display 122. Input interface 118 may be configured to readbitstream 110 stored on transmission medium 104 by source device 102. Inaddition or alternatively, input interface 118 may be configured toreceive, download, and/or stream bitstream 110 from source device 102via transmission medium 104. Input interface 118 may comprise a wiredand/or wireless receiver configured to receive, download, and/or streambitstream 110 according to one or more proprietary and/or standardizedcommunication protocols, such as those mentioned above.

Decoder 120 may decode video sequence 108 from encoded bit stream 110.To decode video sequence 108, decoder 120 may generate prediction blocksfor pictures of video sequence 108 in a similar manner as encoder 114and determine prediction errors for the blocks. Decoder 120 may generatethe prediction blocks using prediction types, prediction modes, and/ormotion vectors received in encoded bit stream 110 and determine theprediction errors using transform coefficients also received in encodedbit stream 110. Decoder 120 may determine the prediction errors byweighting transform basis functions using the transform coefficients.Decoder 120 may combine the prediction blocks and prediction errors todecode video sequence 108. In some examples, decoder 120 may decode avideo sequence that approximates video sequence 108 due to, for example,lossy compression of video sequence 108 by encoder 114 and/or errorsintroduced into encoded bit stream 110 during transmission todestination device 106.

Video display 122 may display video sequence 108 to a user. Videodisplay 122 may comprise a cathode rate tube (CRT) display, liquidcrystal display (LCD), a plasma display, light emitting diode (LED)display, or any other display device suitable for displaying videosequence 108.

It should be noted that video encoding/decoding system 100 is presentedby way of example and not limitation. In the example of FIG. 1 , videoencoding/decoding system 100 may have other components and/orarrangements. For example, video source 112 may be external to sourcedevice 102. Similarly, video display device 122 may be external todestination device 106 or omitted altogether where video sequence isintended for consumption by a machine and/or storage device. In anotherexample, source device 102 may further comprise a video decoder anddestination device 104 may comprise a video encoder. In such an example,source device 102 may be configured to further receive an encoded bitstream from destination device 106 to support two-way video transmissionbetween the devices.

In the example of FIG. 1 , encoder 114 and decoder 120 may operateaccording to any one of a number of proprietary or industry video codingstandards. For example, encoder 114 and decoder 120 may operateaccording to one or more of International Telecommunications UnionTelecommunication Standardization Sector (ITU-T) H.263, ITU-T H.264 andMoving Picture Expert Group (MPEG)-4 Visual (also known as AdvancedVideo Coding (AVC)), ITU-T H.265 and MPEG-H Part 2 (also known as HighEfficiency Video Coding (HEVC), ITU-T H.265 and MPEG-I Part 3 (alsoknown as Versatile Video Coding (VVC)), the WebM VP8 and VP9 codecs, andAOMedia Video 1 (AV1).

FIG. 2 illustrates an exemplary encoder 200 in which embodiments of thepresent disclosure may be implemented. Encoder 200 encodes a videosequence 202 into a bitstream 204 for more efficient storage and/ortransmission. Encoder 200 may be implemented in video coding/decodingsystem 100 in FIG. 1 or in any one of a number of different devices,including a desktop computer, laptop computer, tablet computer, smartphone, wearable device, television, camera, video gaming console,set-top box, or video streaming device. Encoder 200 comprises an interprediction unit 206, an intra prediction unit 208, combiners 210 and212, a transform and quantization unit (TR+Q) unit 214, an inversetransform and quantization unit (iTR+iQ) 216, entropy coding unit 218,one or more filters 220, and a buffer 222.

Encoder 200 may partition the pictures of video sequence 202 into blocksand encode video sequence 202 on a block-by-block basis. Encoder 200 mayperform a prediction technique on a block being encoded using eitherinter prediction unit 206 or intra prediction unit 208. Inter predictionunit 206 may perform inter prediction by searching for a block similarto the block being encoded in another, reconstructed picture (alsoreferred to as a reference picture) of video sequence 202. Areconstructed picture refers to a picture that was encoded and thendecoded. The block determined during the search (also referred to as aprediction block) may then be used to predict the block being encoded toremove redundant information. Inter prediction unit 206 may exploittemporal redundancy or similarities in scene content from picture topicture in video sequence 202 to determine the prediction block. Forexample, scene content between pictures of video sequence 202 may besimilar except for differences due to motion or affine transformation ofthe screen content over time.

Intra prediction unit 208 may perform intra prediction by forming aprediction block based on data from reconstructed neighboring samples ofthe block to be encoded within the same picture of video sequence 202. Areconstructed sample refers to a sample that was encoded and thendecoded. Intra prediction unit 208 may exploit spatial redundancy orsimilarities in scene content within a picture of video sequence 202 todetermine the prediction block. For example, the texture of a region ofscene content in a picture may be similar to the texture in theimmediate surrounding area of the region of the scene content in thesame picture.

After prediction, combiner 210 may determine a prediction error (alsoreferred to as a residual) based on the difference between the blockbeing encoded and the prediction block. The prediction error mayrepresent non-redundant information that may be transmitted to a decoderfor accurate decoding of a video sequence.

Transform and quantization unit 214 may transform and quantize theprediction error.

Transform and quantization unit 214 may transform the prediction errorinto transform coefficients by applying, for example, a DCT to reducecorrelated information in the prediction error. Transform andquantization unit 214 may quantize the coefficients by mapping data ofthe transform coefficients to a predefined set of representative values.Transform and quantization unit 214 may quantize the coefficients toreduce irrelevant information in bitstream 204. Irrelevant informationis information that may be removed from the coefficients withoutproducing visible and/or perceptible distortion in video sequence 202after decoding.

Entropy coding unit 218 may apply one or more entropy coding methods tothe quantized transform coefficients to further reduce the bit rate. Forexample, entropy coding unit 218 may apply context adaptive variablelength coding (CAVLC), context adaptive binary arithmetic coding(CABAC), and syntax-based context-based binary arithmetic coding (SBAC).The entropy coded coefficients are packed to form bitstream 204.

Inverse transform and quantization unit 216 may inverse quantize andinverse transform the quantized transform coefficients to determine areconstructed prediction error. Combiner 212 may combine thereconstructed prediction error with the prediction block to form areconstructed block. Filter(s) 220 may filter the reconstructed blockusing, for example, a deblocking filter and/or a sample-adaptive offset(SAO) filter. Buffer 222 may store the reconstructed block forprediction of one or more other blocks in the same and/or differentpicture of video sequence 202.

Although not shown in FIG. 2 , encoder 200 further comprises an encodercontrol unit configured to control one or more of the units of encoder200 shown in FIG. 2 . The encoder control unit may control the one ormore units of encoder 200 such that bitstream 204 is generated inconformance with the requirements of any one of a number of proprietaryor industry video coding standards. For example, The encoder controlunit may control the one or more units of encoder 200 such thatbitstream 204 is generated in conformance with one or more of ITU-TH.263, AVC, HEVC, VVC, VP8, VP9, and AV1 video coding standards.

Within the constraints of a proprietary or industry video codingstandard, the encoder control unit may attempt to minimize or reduce thebitrate of bitstream 204 and maximize or increase the reconstructedvideo quality. For example, the encoder control unit may attempt tominimize or reduce the bitrate of bitstream 204 given a level that thereconstructed video quality may not fall below, or attempt to maximizeor increase the reconstructed video quality given a level that the bitrate of bitstream 204 may not exceed. The encoder control unit maydetermine/control one or more of: partitioning of the pictures of videosequence 202 into blocks, whether a block is inter predicted by interprediction unit 206 or intra predicted by intra prediction unit 208, amotion vector for inter prediction of a block, an intra prediction modeamong a plurality of intra prediction modes for intra prediction of ablock, filtering performed by filter(s) 220, and one or more transformtypes and/or quantization parameters applied by transform andquantization unit 214. The encoder control unit may determine/controlthe above based on how the determination/control effects arate-distortion measure for a block or picture being encoded. Theencoder control unit may determine/control the above to reduce therate-distortion measure for a block or picture being encoded.

After being determined, the prediction type used to encode a block(intra or inter prediction), prediction information of the block (intraprediction mode if intra predicted, motion vector, etc.), and transformand quantization parameters, may be sent to entropy coding unit 218 tobe further compressed to reduce the bit rate. The prediction type,prediction information, and transform and quantization parameters may bepacked with the prediction error to form bitstream 204.

It should be noted that encoder 200 is presented by way of example andnot limitation. In other examples, encoder 200 may have other componentsand/or arrangements. For example, one or more of the components shown inFIG. 2 may be optionally included in encoder 200, such as entropy codingunit 218 and filters(s) 220.

FIG. 3 illustrates an exemplary decoder 300 in which embodiments of thepresent disclosure may be implemented. Decoder 300 decodes an bitstream302 into a decoded video sequence for display and/or some other form ofconsumption. Decoder 300 may be implemented in video coding/decodingsystem 100 in FIG. 1 or in any one of a number of different devices,including a desktop computer, laptop computer, tablet computer, smartphone, wearable device, television, camera, video gaming console,set-top box, or video streaming device. Decoder 300 comprises an entropydecoding unit 306, an inverse transform and quantization (iTR+iQ) unit308, a combiner 310, one or more filters 312, a buffer 314, an interprediction unit 316, and an intra prediction unit 318.

Although not shown in FIG. 3 , decoder 300 further comprises a decodercontrol unit configured to control one or more of the units of decoder300 shown in FIG. 3 . The decoder control unit may control the one ormore units of decoder 300 such that bitstream 302 is decoded inconformance with the requirements of any one of a number of proprietaryor industry video coding standards. For example, The decoder controlunit may control the one or more units of decoder 300 such thatbitstream 302 is decoded in conformance with one or more of ITU-T H.263,AVC, HEVC, VVC, VP8, VP9, and AV1 video coding standards.

The decoder control unit may determine/control one or more of: whether ablock is inter predicted by inter prediction unit 316 or intra predictedby intra prediction unit 318, a motion vector for inter prediction of ablock, an intra prediction mode among a plurality of intra predictionmodes for intra prediction of a block, filtering performed by filter(s)312, and one or more inverse transform types and/or inverse quantizationparameters to be applied by inverse transform and quantization unit 308.One or more of the control parameters used by the decoder control unitmay be packed in bitstream 302.

Entropy decoding unit 306 may entropy decode the bitstream 302. Inversetransform and quantization unit 308 may inverse quantize and inversetransform the quantized transform coefficients to determine a decodedprediction error. Combiner 310 may combine the decoded prediction errorwith a prediction block to form a decoded block. The prediction blockmay be generated by inter prediction unit 318 or inter prediction unit316 as described above with respect to encoder 200 in FIG. 2 . Filter(s)312 may filter the decoded block using, for example, a deblocking filterand/or a sample-adaptive offset (SAO) filter. Buffer 314 may store thedecoded block for prediction of one or more other blocks in the sameand/or different picture of the video sequence in bitstream 302. Decodedvideo sequence 304 may be output from filter(s) 312 as shown in FIG. 3 .

It should be noted that decoder 300 is presented by way of example andnot limitation. In other examples, decoder 300 may have other componentsand/or arrangements. For example, one or more of the components shown inFIG. 3 may be optionally included in decoder 300, such as entropydecoding unit 306 and filters(s) 312.

It should be further noted that, although not shown in FIGS. 2 and 3 ,each of encoder 200 and decoder 300 may further comprise an intra blockcopy unit in addition to inter prediction and intra prediction units.The intra block copy unit may perform similar to an inter predictionunit but predict blocks within the same picture. For example, the intrablock copy unit may exploit repeated patterns that appear in screencontent. Screen content may include, for example, computer generatedtext, graphics, and animation.

As mentioned above, video encoding and decoding may be performed on ablock-by-block basis. The process of partitioning a picture into blocksmay be adaptive based on the content of the picture. For example, largerblock partitions may be used in areas of a picture with higher levels ofhomogeneity to improve coding efficiency.

In HEVC, a picture may be partitioned into non-overlapping squareblocks, referred to as coding tree blocks (CTBs), comprising samples ofa sample array. A CTB may have a size of 2n×2n samples, where n may bespecified by a parameter of the encoding system. For example, n may be4, 5, or 6. A CTB may be further partitioned by a recursive quadtreepartitioning into coding blocks (CBs) of half vertical and halfhorizontal size. The CTB forms the root of the quadtree. A CB that isnot split further as part of the recursive quadtree partitioning may bereferred to as a leaf-CB of the quadtree and otherwise as a non-leaf CBof the quadtree. A CB may have a minimum size specified by a parameterof the encoding system. For example, a CB may have a minimum size of4×4, 8×8, 16×16, 32×32, or 64×64 samples. For inter and intraprediction, a CB may be further partitioned into one or more predictionblocks (PBs) for performing inter and intra prediction. A PB may be arectangular block of samples on which the same prediction type/mode maybe applied. For transformations, a CB may be partitioned into one ormore transform blocks (TBs). A TB may be a rectangular block of samplesthat may determine an applied transform size.

FIG. 4 illustrates an example quadtree partitioning of a CTB 400. FIG. 5illustrates a corresponding quadtree 500 of the example quadtreepartitioning of CTB 400 in FIG. 4 . As shown in FIGS. 4 and 5 , CTB 400is first partitioned into four CBs of half vertical and half horizontalsize. Three of the resulting CBs of the first level partitioning of CTB400 are leaf-CBs. The three leaf CBs of the first level partitioning ofCTB 400 are respectively labeled 7, 8, and 9 in FIGS. 4 and 5 . Thenon-leaf CB of the first level partitioning of CTB 400 is partitionedinto four sub-CBs of half vertical and half horizontal size. Three ofthe resulting sub-CBs of the second level partitioning of CTB 400 areleaf CBs. The three leaf CBs of the second level partitioning of CTB 400are respectively labeled 0, 5, and 6 in FIGS. 4 and 5 . Finally, thenon-leaf CB of the second level partitioning of CTB 400 is partitionedinto four leaf CBs of half vertical and half horizontal size. The fourleaf CBs are respectively labeled 1, 2, 3, and 4 in FIGS. 4 and 5 .

Altogether, CTB 400 is partitioned into 10 leaf CBs respectively labeled0-9. The resulting quadtree partitioning of CTB 400 may be scanned usinga z-scan (left-to-right, top-to-bottom) to form the sequence order forencoding/decoding the CB leaf nodes. The numeric label of each CB leafnode in FIGS. 4 and 5 may correspond to the sequence order forencoding/decoding, with CB leaf node 0 encoded/decoded first and CB leafnode 9 encoded/decoded last. Although not shown in FIGS. 4 and 5 , itshould be noted that each CB leaf node may comprise one or more PBs andTBs.

In VVC, a picture may be partitioned in a similar manner as in HEVC. Apicture may be first partitioned into non-overlapping square CTBs. TheCTBs may then be partitioned by a recursive quadtree partitioning intoCBs of half vertical and half horizontal size. In VVC, a quadtree leafnode may be further partitioned by a binary tree or ternary treepartitioning into CBs of unequal sizes. FIG. 6 illustrates examplebinary and ternary tree partitions. A binary tree partition may divide aparent block in half in either the vertical direction 602 or horizontaldirection 604. The resulting partitions may be half in size as comparedto the parent block. A ternary tree partition may divide a parent blockinto three parts in either the vertical direction 606 or horizontaldirection 608. The middle partition may be twice as large as the othertwo end partitions in a ternary tree partition.

Because of the addition of binary and ternary tree partitioning, in VVCthe block partitioning strategy may be referred to asquadtree+multi-type tree partitioning. FIG. 7 illustrates an examplequadtree+multi-type tree partitioning of a CTB 700. FIG. 8 illustrates acorresponding quadtree+multi-type tree 800 of the examplequadtree+multi-type tree partitioning of CTB 700 in FIG. 7 . In bothFIGS. 7 and 8 , quadtree splits are shown in solid lines and multi-typetree splits are shown in dashed lines. For ease of explanation, CTB 700is shown with the same quadtree partitioning as CTB 400 described inFIG. 4 . Therefore, description of the quadtree partitioning of CTB 700is omitted. The description of the additional multi-type tree partitionsof CTB 700 is made relative to three leaf-CBs shown in FIG. 4 that havebeen further partitioned using one or more binary and ternary treepartitions. The three leaf-CBs in FIG. 4 that are shown in FIG. 7 asbeing further partitioned are leaf-CBs 5, 8, and 9.

Starting with leaf-CB 5 in FIG. 4 , FIG. 7 shows this leaf-CBpartitioned into two CBs based on a vertical binary tree partitioning.The two resulting CBs are leaf-CBs respectively labeled 5 and 6 in FIGS.7 and 8 . With respect to leaf-CB 8 in FIG. 4 , FIG. 7 shows thisleaf-CB partitioned into three CBs based on a vertical ternary treepartition. Two of the three resulting CBs are leaf-CBs respectivelylabeled 9 and 14 in FIGS. 7 and 8 . The remaining, non-leaf CB ispartitioned first into two CBs based on a horizontal binary treepartition, one of which is a leaf-CB labeled 10 and the other of whichis further partitioned into three CBs based on a vertical ternary treepartition. The resulting three CBs are leaf-CBs respectively labeled 11,12, and 13 in FIGS. 7 and 8 . Finally, with respect to leaf-CB 9 in FIG.4 , FIG. 7 shows this leaf-CB partitioned into three CBs based on ahorizontal ternary tree partition. Two of the three CBs are leaf-CBsrespectively labeled 15 and 19 in FIGS. 7 and 8 . The remaining,non-leaf CB is partitioned into three CBs based on another horizontalternary tree partition. The resulting three CBs are all leaf-CBsrespectively labeled 16, 17, and 18 in FIGS. 7 and 8 .

Altogether, CTB 700 is partitioned into 20 leaf CBs respectively labeled0-19. The resulting quadtree+multi-type tree partitioning of CTB 700 maybe scanned using a z-scan (left-to-right, top-to-bottom) to form thesequence order for encoding/decoding the CB leaf nodes. The numericlabel of each CB leaf node in FIGS. 7 and 8 may correspond to thesequence order for encoding/decoding, with CB leaf node 0encoded/decoded first and CB leaf node 19 encoded/decoded last. Althoughnot shown in FIGS. 7 and 8 , it should be noted that each CB leaf nodemay comprise one or more PBs and TBs.

In addition to specifying various blocks (e.g., CTB, CB, PB, TB), HEVCand VVC further define various units. While blocks may comprise arectangular area of samples in a sample array, units may comprise thecollocated blocks of samples from the different sample arrays (e.g.,luma and chroma sample arrays) that form a picture as well as syntaxelements and prediction data of the blocks. A coding tree unit (CTU) maycomprise the collocated CTBs of the different sample arrays and may forma complete entity in an encoded bit stream. A coding unit (CU) maycomprise the collocated CBs of the different sample arrays and syntaxstructures used to code the samples of the CBs. A prediction unit (PU)may comprise the collocated PBs of the different sample arrays andsyntax elements used to predict the PBs. A transform unit (TU) maycomprise TBs of the different samples arrays and syntax elements used totransform the TBs.

It should be noted that the term block may be used to refer to any of aCTB, CB, PB, TB, CTU, CU, PU, or TU in the context of HEVC and VVC. Itshould be further noted that the term block may be used to refer tosimilar data structures in the context of other video coding standards.For example, the term block may refer to a macroblock in AVC, amacroblock or sub-block in VP8, a superblock or sub-block in VP9, or asuperblock or sub-block in AV1.

In intra prediction, samples of a block to be encoded (also referred toas the current block) may be predicted from samples of the columnimmediately adjacent to the left-most column of the current block andsamples of the row immediately adjacent to the top-most row of thecurrent block. The samples from the immediately adjacent column and rowmay be jointly referred to as reference samples. Each sample of thecurrent block may be predicted by projecting the position of the samplein the current block in a given direction (also referred to as an intraprediction mode) to a point along the reference samples. The sample maybe predicted by interpolating between the two closest reference samplesof the projection point if the projection does not fall directly on areference sample. A prediction error (also referred to as a residual)may be determined for the current block based on differences between thepredicted sample values and the original sample values of the currentblock.

At an encoder, this process of predicting samples and determining aprediction error based on a difference between the predicted samples andoriginal samples may be performed for a plurality of different intraprediction modes, including non-directional intra prediction modes. Theencoder may select one of the plurality of intra prediction modes andits corresponding prediction error to encode the current block. Theencoder may send an indication of the selected prediction mode and itscorresponding prediction error to a decoder for decoding of the currentblock. The decoder may decode the current block by predicting thesamples of the current block using the intra prediction mode indicatedby the encoder and combining the predicted samples with the predictionerror.

FIG. 9 illustrates an example set of reference samples 902 determinedfor intra prediction of a current block 904 being encoded or decoded. InFIG. 9 , current block 904 corresponds to block 3 of partitioned CTB 700in FIG. 7 . As explained above, the numeric labels 0-19 of the blocks ofpartitioned CTB 700 may correspond to the sequence order forencoding/decoding the blocks and are used as such in the example of FIG.9 .

Given current block 904 is of w×h samples in size, reference samples 902may extend over 2w samples of the row immediately adjacent to thetop-most row of current block 904, 2 h samples of the column immediatelyadjacent to the left-most column of current block 904, and the top leftneighboring corner sample to current block 904. In the example of FIG. 9, current block 904 is square, so w=h=s. For constructing the set ofreference samples 902, available samples from neighboring blocks ofcurrent block 904 may be used. Samples may not be available forconstructing the set of reference samples 902 if, for example, thesamples would lie outside the picture of the current block, the samplesare part of a different slice of the current block (where the concept ofslices are used), and/or the samples belong to blocks that have beeninter coded and constrained intra prediction is indicated. Whenconstrained intra prediction is indicated, intra prediction may not bedependent on inter predicted blocks.

In addition to the above, samples that may not be available forconstructing the set of reference samples 902 include samples in blocksthat have not already been encoded and reconstructed at an encoder ordecoded at a decoder based on the sequence order for encoding/decoding.This restriction may allow identical prediction results to be determinedat both the encoder and decoder. In FIG. 9 , samples from neighboringblocks 0, 1, and 2 may be available to construct reference samples 902given that these blocks are encoded and reconstructed at an encoder anddecoded at a decoder prior to coding of current block 904. This assumesthere are no other issues, such as those mentioned above, preventing theavailability of samples from neighboring blocks 0, 1, and 2. However,the portion of reference samples 902 from neighboring block 6 may not beavailable due to the sequence order for encoding/decoding.

Unavailable ones of reference samples 902 may be filled with availableones of reference samples 902. For example, an unavailable referencesample may be filled with a nearest available reference sampledetermined by moving in a clock-wise direction through reference samples902 from the position of the unavailable reference. If no referencesamples are available, reference samples 902 may be filled with themid-value of the dynamic range of the picture being coded.

It should be noted that reference samples 902 may be filtered based onthe size of current block 904 being coded and an applied intraprediction mode. It should be further noted that FIG. 9 illustrates onlyone exemplary determination of reference samples for intra prediction ofa block. In some proprietary and industry video coding standards,reference samples may be determined in a different manner than discussedabove. For example, multiple reference lines may be used in otherinstances, such as used in VVC.

After reference samples 902 are determined and optionally filtered,samples of current block 904 may be intra predicted based on referencesamples 902. Most encoders/decoders support a plurality of intraprediction modes in accordance with one or more video coding standards.For example, HEVC supports 35 intra prediction modes, including a planarmode, a DC mode, and 33 angular modes. VVC supports 67 intra predictionmodes, including a planar mode, a DC mode, and 65 angular modes. Planarand DC modes may be used to predict smooth and gradually changingregions of a picture. Angular modes may be used to predict directionalstructures in regions of a picture.

FIG. 10A illustrates the 35 intra prediction modes supported by HEVC.The 35 intra prediction modes are identified by indices 0 to 34.Prediction mode 0 corresponds to planar mode. Prediction mode 1corresponds to DC mode. Prediction modes 2-34 correspond to angularmodes. Prediction modes 2-18 may be referred to as horizontal predictionmodes because the principal source of prediction is in the horizontaldirection. Prediction modes 19-34 may be referred to as verticalprediction modes because the principal source of prediction is in thevertical direction.

FIG. 10B illustrates the 67 intra prediction modes supported by VVC. The67 intra prediction modes are identified by indices 0 to 66. Predictionmode 0 corresponds to planar mode. Prediction mode 1 corresponds to DCmode. Prediction modes 2-66 correspond to angular modes. Predictionmodes 2-34 may be referred to as horizontal prediction modes because theprincipal source of prediction is in the horizontal direction.Prediction modes 35-66 may be referred to as vertical prediction modesbecause the principal source of prediction is in the vertical direction.Because blocks in VVC may be non-square, some of the intra predictionmodes illustrated in FIG. 10B may be adaptively replaced by wide-angledirections.

To further describe the application of intra prediction modes todetermine a prediction of a current block, reference is made to FIGS. 11and 12 . In FIG. 11 , current block 904 and reference samples 902 fromFIG. 9 are shown in a two-dimensional x, y plane. Current block 904 isreferred to as Cb, where Cb(x, y) denotes the predicted value of currentblock 904 at the coordinates (x, y). Reference samples 902 are referredto as r, where r(x, y) denotes the reference sample of reference samples902 at the coordinates (x, y).

For planar mode, a sample in Cb may be predicted by calculating the meanof two interpolated values. The first of the two interpolated values maybe based on a horizontal linear interpolation of the predicted sample inCb. The second of the two interpolated values may be based on a verticallinear interpolation of the predicted sample in Cb. The predicted valueof the sample in Cb may be calculated as

$\begin{matrix}{{{Cb}\left( {x,y} \right)} = {\frac{1}{2 \cdot s}\left( {{h\left( {x,y} \right)} + {v\left( {x,y} \right)} + s} \right)}} & (1)\end{matrix}$whereh(x,y)=(s−x−1)·r(−1,y)+(x+1)·r(s,−1)  (2)may be the horizonal linear interpolation of the predicted sample in Cbandv(x,y)=(s−y−1)·r(x,−1)+(y+1)·r(−1,s)  (3)may be the vertical linear interpolation of the predicted sample in Cb.

For DC mode, a sample in Cb may be predicted by the mean of thereference samples. The predicted value of the sample in Cb may becalculated as

$\begin{matrix}{{{Cb}\left( {x,y} \right)} = {\frac{1}{2 \cdot s} \cdot \left( {{\sum\limits_{x = 0}^{s - 1}\;{r\left( {x,{- 1}} \right)}} + {\sum\limits_{y = 0}^{s - 1}\;{r\left( {{- 1},y} \right)}}} \right)}} & (4)\end{matrix}$A boundary filter may be applied to boundary samples in Cb to smooth thetransition between the boundary samples and their respective adjacentneighboring reference sample(s) in r.

For angular modes, a sample in Cb may be predicted by projecting theposition of the sample in a direction specified by a given angular modeto a point on the horizontal or vertical axis comprising the referencesamples r. The sample may be predicted by interpolating between the twoclosest reference samples in r of the projection point if the projectiondoes not fall directly on a reference sample in r. The directionspecified by the angular mode may be given by an angle φ definedrelative to the y-axis for vertical prediction modes (e.g., modes 19-34in HEVC and modes 35-66 in VVC) and relative to the x-axis forhorizontal prediction modes (e.g., modes 2-18 in HEVC and modes 2-34 inVVC).

FIG. 12 illustrates a sample in Cb predicted for a vertical predictionmode. For vertical prediction modes, the position (x, y) of the samplein Cb is projected onto the horizontal axis comprising reference samplesr. Because the projection falls between two reference samples r1 and r2in the example of FIG. 12 , the predicted value of the sample in Cb maybe calculated as the linear interpolation between the two referencesamples r1 and r2 asCb(x,y)=(1−Δ)·r1+Δ·r2  (5)wherer1=r(x+└(y+1)·tan φ┘,−1),  (6)r2=r(x+└(y+1)·tan φ┘+1,−1),  (7)Δ=((y+1)·tan φ)−└(y+1)·tan φ┘, and  (8)└·┘ is an integer floor.  (9)

It should be noted that the weighting factors (1−Δ) and Δ may becalculated with some predefined level of precision, such as 1/32 pixelprecision. To avoid floating point operations while preserving thespecified precision, the weighting factors (1−Δ) and Δ may be multipliedby the reciprocal of the specified precision used and then divided bythe reciprocal using, for example, right shift operations. It should befurther noted that supplementary reference samples may be constructedfor the case where the position (x, y) of a sample Cb to predicted isprojected to a negative x coordinate, which happens with negative anglesφ. The supplementary reference samples may be constructed by projectingthe reference samples in r on the vertical axis to the horizontal axisusing the angle φ. Finally, it should be further noted that a sample inCb may be predicted for a horizontal prediction mode in a similar manneras discussed above for vertical prediction modes. For horizontalprediction modes, the position (x, y) of the sample in Cb may beprojected onto the vertical axis comprising reference samples r and theangle φ may be defined relative to the x-axis. Supplemental referencesamples may be similarly constructed for horizontal prediction modes byprojecting the reference samples in r on the horizontal axis to thevertical axis using the angle φ.

An encoder may predict the samples of a current block being encoded,such as current block 904, for a plurality of intra prediction modes asexplained above. For example, the encoder may predict the samples of thecurrent block for each of the 35 intra prediction modes in HEVC or 67intra prediction modes in VVC. For each intra prediction mode applied,the encoder may determine a prediction error for the current block basedon a difference (e.g., sum of squared differences (SSD), sum of absolutedifferences (SAD), or sum of absolute transformed differences (SATD))between the prediction samples determined for the intra prediction modeand the original samples of the current block. The encoder may selectone of the intra prediction modes to encode the current block based onthe determined prediction errors. For example, the encoder may select anintra prediction mode that results in the smallest prediction error forthe current block. In another example, the encoder may select the intraprediction mode to encode the current block based on a rate-distortionmeasure (e.g., Lagrangian rate-distortion cost) determined using theprediction errors. The encoder may send an indication of the selectedintra prediction mode and its corresponding prediction error to adecoder for decoding of the current block.

Although the description above was primarily made with respect to intraprediction modes in HEVC and VVC, it will be understood that thetechniques of the present disclosure described above and further belowmay be applied to other intra prediction modes, including those of othervideo coding standards like VP8, VP9, AV1, and the like.

As explained above, intra prediction may exploit correlations betweenspatially neighboring samples in the same picture of a video sequence toperform video compression. Inter prediction is another coding tool thatmay be used to exploit correlations in the time domain between blocks ofsamples in different pictures of the video sequence to perform videocompression. In general, an object may be seen across multiple picturesof a video sequence. The object may move (e.g., by some translationand/or affine motion) or remain stationary across the multiple pictures.A current block of samples in a current picture being encoded maytherefore have a corresponding block of samples in a previously decodedpicture that accurately predicts the current block of samples. Thecorresponding block of samples may be displaced from the current blockof samples due to movement of an object, represented in both blocks,across the respective pictures of the blocks. The previously decodedpicture may be referred to as a reference picture and the correspondingblock of samples in the reference picture may be referred to as areference block or motion compensated prediction. An encoder may use ablock matching technique to estimate the displacement (or motion) anddetermine the reference block in the reference picture.

Similar to intra prediction, once a prediction for a current block isdetermined and/or generated using inter prediction, an encoder maydetermine a difference between the current block and the prediction. Thedifference may be referred to as a prediction error or residual. Theencoder may then store and/or signal in a bitstream the prediction errorand other related prediction information for decoding or other forms ofconsumption. A decoder may decode the current block by predicting thesamples of the current block using the prediction information andcombining the predicted samples with the prediction error.

FIG. 13A illustrates an example of inter prediction performed for acurrent block 1300 in a current picture 1302 being encoded. An encoder,such as encoder 200 in FIG. 2 , may perform inter prediction todetermine and/or generate a reference block 1304 in a reference picture1306 to predict current block 1300. Reference pictures, like referencepicture 1306, are prior decoded pictures available at the encoder anddecoder. Availability of a prior decoded picture may depend on whetherthe prior decoded picture is available in a decoded picture buffer atthe time current block 1300 is being encoded or decoded. The encodermay, for example, search one or more reference pictures for a referenceblock that is similar to current block 1300. The encoder may determine a“best matching” reference block from the blocks tested during thesearching process as reference block 1304. The encoder may determinethat reference block 1304 is the best matching reference block based onone or more cost criterion, such as a rate-distortion criterion (e.g.,Lagrangian rate-distortion cost). The one or more cost criterion may bebased on, for example, a difference (e.g., sum of squared differences(SSD), sum of absolute differences (SAD), or sum of absolute transformeddifferences (SATD)) between the prediction samples of reference block1304 and the original samples of current block 1300.

The encoder may search for reference block 1304 within a search range1308. Search range 1308 may be positioned around the collocated position(or block) 1310 of current block 1300 in reference picture 1306. In someinstances, search range 1308 may at least partially extend outside ofreference picture 1306. When extending outside of reference picture1306, constant boundary extension may be used such that the values ofthe samples in the row or column of reference picture 1306, immediatelyadjacent to the portion of search range 1308 extending outside ofreference picture 1306, are used for the “sample” locations outside ofreference picture 1306. All or a subset of potential positions withinsearch range 1308 may be searched for reference block 1304. The encodermay utilize any one of a number of different search implementations todetermine and/or generate reference block 1304. For example, the encodermay determine a set of a candidate search positions based on motioninformation of neighboring blocks to current block 1300.

One or more reference pictures may be searched by the encoder duringinter prediction to determine and/or generate the best matchingreference block. The reference pictures searched by the encoder may beincluded in one or more reference picture lists. For example, in HEVCand VVC, two reference picture lists may be used, a reference picturelist 0 and a reference picture list 1. A reference picture list mayinclude one or more pictures. Reference picture 1306 of reference block1304 may be indicated by a reference index pointing into a referencepicture list comprising reference picture 1306.

The displacement between reference block 1304 and current block 1300 maybe interpreted as an estimate of the motion between reference block 1304and current block 1300 across their respective pictures. Thedisplacement may be represented by a motion vector 1312. For example,motion vector 1312 may be indicated by a horizontal component (MV_(x))and a vertical component (MV_(y)) relative to the position of currentblock 1300. FIG. 13B illustrates the horizontal component and verticalcomponent of motion vector 1312. A motion vector, such as motion vector1312, may have fractional or integer resolution. A motion vector withfractional resolution may point between two samples in a referencepicture to provide a better estimation of the motion of current block1300. For example, a motion vector may have ½, ¼, ⅛, 1/16, or 1/32fractional sample resolution. When a motion vector points to anon-integer sample value in the reference picture, interpolation betweensamples at integer positions may be used to generate the reference blockand its corresponding samples at fractional positions. The interpolationmay be performed by a filter with two or more taps.

Once reference block 1304 is determined and/or generated for currentblock 1300 using inter prediction, the encoder may determine adifference (e.g., a corresponding sample-by-sample difference) betweenreference block 1304 and current block 1300. The difference may bereferred to as a prediction error or residual. The encoder may thenstore and/or signal in a bitstream the prediction error and the relatedmotion information for decoding or other forms of consumption. Themotion information may include motion vector 1312 and a reference indexpointing into a reference picture list comprising reference picture1306. In other instances, the motion information may include anindication of motion vector 1312 and an indication of the referenceindex pointing into the reference picture list comprising referencepicture 1306. A decoder may decode current block 1300 by determiningand/or generating reference block 1304, which forms the prediction ofcurrent block 1300, using the motion information and combining theprediction with the prediction error.

In FIG. 13A, inter prediction is performed using one reference picture1306 as the source of the prediction for current block 1300. Because theprediction for current block 1300 comes from a single picture, this typeof inter prediction is referred to as uni-prediction. FIG. 14illustrates another type of inter prediction, referred to asbi-prediction, performed for a current block 1400. In bi-prediction, thesource of the prediction for a current block 1400 comes from twopictures. Bi-prediction may be useful, for example, where the videosequence comprises fast motion, camera panning or zooming, or scenechanges. Bi-prediction may also be useful to capture fade outs of onescene or fade outs from one scene to another, where two pictures areeffectively displayed simultaneously with different levels of intensity.

Whether uni-prediction or both uni-prediction and bi-prediction areavailable for performing inter prediction may depend on a slice type ofcurrent block 1400. For P slices, only uni-prediction may be availablefor performing inter prediction. For B slices, either uni-prediction orbi-prediction may be used. When uni-prediction is performed, an encodermay determine and/or generate a reference block for predicting currentblock 1400 from reference picture list 0. When bi-prediction isperformed, an encoder may determine and/or generate a first referenceblock for predicting current block 1400 from reference picture list 0and determine and/or generate a second reference block for predictingcurrent block 1400 from reference picture list 1.

In FIG. 14 , inter-prediction is performed using bi-prediction, wheretwo reference blocks 1402 and 1404 are used to predict current block1400. Reference block 1402 may be in a reference picture of one ofreference picture list 0 or 1, and reference block 1404 may be in areference picture of the other one of reference picture list 0 or 1. Asshown in FIG. 14 , reference block 1402 is in a picture that precedesthe current picture of current block 1400 in terms of picture ordercount (POC), and reference block 1402 is in a picture that proceeds thecurrent picture of current block 1400 in terms of POC. In otherexamples, the reference pictures may both precede or procced the currentpicture in terms of POC. POC is the order in which pictures are outputfrom, for example, a decoded picture buffer and is the order in whichpictures are generally intended to be displayed. However, it should benoted that pictures that are output are not necessarily displayed butmay undergo different processing or consumption, such as transcoding. Inother examples, the two reference blocks determined and/or generatedusing bi-prediction may come from the same reference picture. In such aninstance, the reference picture may be included in both referencepicture list 0 and reference picture list 1.

A configurable weight and offset value may be applied to the one or moreinter prediction reference blocks. An encoder may enable the use ofweighted prediction using a flag in a picture parameter set (PPS) andsignal the weighting and offset parameters in the slice segment headerfor the current block. Different weight and offset parameters may besignaled for luma and chroma components.

Once reference blocks 1402 and 1404 are determined and/or generated forcurrent block 1400 using inter prediction, the encoder may determine adifference between current block 1400 and each of reference blocks 1402and 1404. The differences may be referred to as prediction errors orresiduals. The encoder may then store and/or signal in a bitstream theprediction errors and their respective related motion information fordecoding or other forms of consumption. The motion information forreference block 1402 may include motion vector 1406 and the referenceindex pointing into the reference picture list comprising the referencepicture of reference block 1402. In other instances, the motioninformation for reference block 1402 may include an indication of motionvector 1406 and an indication of the reference index pointing into thereference picture list comprising reference picture 1402. The motioninformation for reference block 1404 may include motion vector 1408 andthe reference index pointing into the reference picture list comprisingthe reference picture of reference block 1404. In other instances, themotion information for reference block 1404 may include an indication ofmotion vector 1408 and an indication of the reference index pointinginto the reference picture list comprising reference picture 1404. Adecoder may decode current block 1400 by determining and/or generatingreference blocks 1402 and 1404, which together form the prediction ofcurrent block 1400, using their respective motion information andcombining the predictions with the prediction errors.

In HEVC, VVC, and other video compression schemes, motion informationmay be predictively coded before being stored or signaled in a bitstream. The motion information for a current block may be predictivelycoded based on the motion information of neighboring blocks of thecurrent block. In general, the motion information of the neighboringblocks is often correlated with the motion information of the currentblock because the motion of an object represented in the current blockis often the same or similar to the motion of objects in the neighboringblocks. Two of the motion information prediction techniques in HEVC andVVC include advanced motion vector prediction (AMVP) and interprediction block merging.

An encoder, such as encoder 200 in FIG. 2 , may code a motion vectorusing the AMVP tool as a difference between the motion vector of acurrent block being coded and a motion vector predictor (MVP). Anencoder may select the MVP from a list of candidate MVPs. The candidateMVPs may come from previously decoded motion vectors of neighboringblocks in the current picture of the current block or blocks at or nearthe collocated position of the current block in other referencepictures. Both the encoder and decoder may generate or determine thelist of candidate MVPs.

After the encoder selects an MVP from the list of candidate MVPs, theencoder may signal, in a bitstream, an indication of the selected MVPand a motion vector difference (MVD). The encoder may indicate theselected MVP in the bitstream by an index pointing into the list ofcandidate MVPs. The MVD may be calculated based on the differencebetween the motion vector of the current block and the selected MVP. Forexample, for a motion vector represented by a horizontal component(MV_(x)) and a vertical displacement (MV_(y)) relative to the positionof the current block being coded, the MVD may be represented by twocomponents calculated as follows:MVD_(x)=MV_(x)−MVP_(x)  (10)MVD_(y)=MV_(y)−MVP_(y)  (11)where MVD_(x) and MVD_(y) respectively represent the horizontal andvertical components of the MVD, and MVP_(x) and MVP_(y) respectivelyrepresent the horizontal and vertical components of the MVP. A decoder,such as decoder 300 in FIG. 3 , may decode the motion vector by addingthe MVD to the MVP indicated in the bitstream. The decoder may thendecode the current block by determining and/or generating the referenceblock, which forms the prediction of the current block, using thedecoded motion vector and combining the prediction with the predictionerror.

In HEVC and VVC, the list of candidate MVPs for AMVP may comprise twocandidates referred to as candidates A and B. Candidates A and B mayinclude up to two spatial candidate MVPs derived from five spatialneighboring blocks of the current block being coded, one temporalcandidate MVP derived from two temporal, co-located blocks when bothspatial candidate MVPs are not available or are identical, or zeromotion vectors when the spatial, temporal, or both candidates are notavailable. FIG. 15A illustrates the location of the five spatialcandidate neighboring blocks relative to a current block 1500 beingencoded. The five spatial candidate neighboring blocks are respectivelydenoted A₀, A₁, B₀, B₁, and B₂. FIG. 15B illustrates the location of thetwo temporal, co-located blocks relative to current block 1500 beingcoded. The two temporal, co-located blocks are denoted C₀ and C₁ and areincluded in a reference picture that is different from the currentpicture of current block 1500.

An encoder, such as encoder 200 in FIG. 2 , may code a motion vectorusing the inter prediction block merging tool also referred to as mergemode. Using merge mode, the encoder may reuse the same motioninformation of a neighboring block for inter prediction of a currentblock. Because the same motion information of a neighboring block isused, no MVD needs to be signaled and the signaling overhead forsignaling the motion information of the current block may be small insize. Similar to AMVP, both the encoder and decoder may generate acandidate list of motion information from neighboring blocks of thecurrent block. The encoder may then determine to use (or inherit) themotion information of one neighboring block's motion information in thecandidate list for predicting the motion information of the currentblock being coded. The encoder may signal, in the bit stream, anindication of the determined motion information from the candidate list.For example, the encoder may signal an index pointing into the list ofcandidate motion information to indicate the determined motioninformation.

In HEVC and VVC, the list of candidate motion information for merge modemay comprise up to four spatial merge candidates that are derived fromthe five spatial neighboring blocks used in AMVP as shown in FIG. 15A,one temporal merge candidate derived from two temporal, co-locatedblocks used in AMVP as shown in FIG. 15B, and additional mergecandidates including bi-predictive candidates and zero motion vectorcandidates.

It should be noted that inter prediction may be performed in other waysand variants than those described above. For example, motion informationprediction techniques other than AMVP and merge mode are possible. Inaddition, although the description above was primarily made with respectto inter prediction modes in HEVC and VVC, it will be understood thatthe techniques of the present disclosure described above and furtherbelow may be applied to other inter prediction modes, including those ofother video coding standards like VP8, VP9, AV1, and the like. Inaddition, history based motion vector prediction (HMVP), combinedintra/inter prediction mode (CIIP), and merge mode with motion vectordifference (MMVD) as described in VVC may also be performed and arewithin the scope of the present disclosure.

In inter prediction, a block matching technique may be applied todetermine a reference block in a different picture than the currentblock being encoded. Block matching techniques have also been applied todetermine a reference block in the same picture as a current block beingencoded. However, it has been determined that for camera-capturedvideos, a reference block in the same picture as the current blockdetermined using block matching may often not accurately predict thecurrent block. For screen content video this is generally not the case.Screen content video may include, for example, computer generated text,graphics, and animation. Within screen content, there is often repeatedpatterns (e.g., repeated patterns of text and graphics) within the samepicture. Therefore, a block matching technique applied to determine areference block in the same picture as a current block being encoded mayprovide efficient compression for screen content video.

HEVC and VVC both include a prediction technique to exploit thecorrelation between blocks of samples within the same picture of screencontent video. This technique is referred to as intra block (IBC) orcurrent picture referencing (CPR). Similar to inter prediction, anencoder may apply a block matching technique to determine a displacementvector (referred to as a block vector (BV)) that indicates the relativedisplacement from the current block to a reference block (or intra blockcompensated prediction) that “best matches” the current block. Theencoder may determine the best matching reference block from blockstested during a searching process similar to inter prediction. Theencoder may determine that a reference block is the best matchingreference block based on one or more cost criterion, such as arate-distortion criterion (e.g., Lagrangian rate-distortion cost). Theone or more cost criterion may be based on, for example, a difference(e.g., sum of squared differences (SSD), sum of absolute differences(SAD), sum of absolute transformed differences (SATD), or differencedetermined based on a hash function) between the prediction samples ofthe reference block and the original samples of the current block. Areference block may correspond to prior decoded blocks of samples of thecurrent picture. The reference block may comprise decoded blocks ofsamples of the current picture prior to being processed by in-loopfiltering operations, like deblocking or SAO filtering. FIG. 16illustrates an example of IBC applied for screen content. Therectangular portions with arrows beginning at their boundaries arecurrent blocks being encoded and the rectangular portions that thearrows point to are the reference blocks for predicting the currentblocks.

Once a reference block is determined and/or generated for a currentblock using IBC, the encoder may determine a difference (e.g., acorresponding sample-by-sample difference) between the reference blockand the current block. The difference may be referred to as a predictionerror or residual. The encoder may then store and/or signal in abitstream the prediction error and the related prediction informationfor decoding or other forms of consumption. The prediction informationmay include a BV. In other instances, the prediction information mayinclude an indication of the BV. A decoder, such as decoder 300 in FIG.3 , may decode the current block by determining and/or generating thereference block, which forms the prediction of the current block, usingthe prediction information and combining the prediction with theprediction error.

In HEVC, VVC, and other video compression schemes, a BV may bepredictively coded before being stored or signaled in a bit stream. TheBV for a current block may be predictively coded based on the BV ofneighboring blocks of the current block. For example, an encoder maypredictively code a BV using the merge mode as explained above for interprediction or a similar technique as AMVP also explained above for interprediction. The technique similar to AMVP may be referred to as BVprediction and difference coding.

For BV prediction and difference coding, an encoder, such as encoder 200in FIG. 2 , may code a BV as a difference between the BV of a currentblock being coded and a BV predictor (BVP). An encoder may select theBVP from a list of candidate BVPs. The candidate BVPs may come frompreviously decoded BVs of neighboring blocks of the current block in thecurrent picture. Both the encoder and decoder may generate or determinethe list of candidate BVPs.

After the encoder selects a BVP from the list of candidate BVPs, theencoder may signal, in a bitstream, an indication of the selected BVPand a BV difference (BVD). The encoder may indicate the selected BVP inthe bitstream by an index pointing into the list of candidate BVPs. TheBVD may be calculated based on the difference between the BV of thecurrent block and the selected BVP. For example, for a BV represented bya horizontal component (BV_(x)) and a vertical component (BV_(y))relative to the position of the current block being coded, the BVD mayrepresented by two components calculated as follows:BVD_(x)=BV_(x)−BVP_(x)  (12)BVD_(y)=BV_(y)−BVP_(y)  (13)where BVD_(x) and BVD_(y) respectively represent the horizontal andvertical components of the BVD, and BVP_(x) and BVP_(y) respectivelyrepresent the horizontal and vertical components of the BVP. A decoder,such as decoder 300 in FIG. 3 , may decode the BV by adding the BVD tothe BVP indicated in the bitstream. The decoder may then decode thecurrent block by determining and/or generating the reference block,which forms the prediction of the current block, using the decoded BVand combining the prediction with the prediction error.

In HEVC and VVC, the list of candidate BVPs may comprise two candidatesreferred to as candidates A and B. Candidates A and B may include up totwo spatial candidate BVPs derived from five spatial neighboring blocksof the current block being encoded, or one or more of the last two codedBVs when spatial neighboring candidates are not available (e.g., becausethey are coded in intra or inter mode). The location of the five spatialcandidate neighboring blocks relative to a current block being encodedusing IBC are the same as those shown in FIG. 15A for inter prediction.The five spatial candidate neighboring blocks are respectively denotedA₀, A₁, B₀, B₁, and B₂.

FIG. 17 illustrates an example IBC prediction performed by an encoder,such as encoder 200 in FIG. 2 . FIG. 17 illustrates, within a currentframe, an IBC search range 1702 (shown with a dotted pattern), a blockvector (BV) 1704, a reference block 1706, and a current block 1708. Theencoder may determine BV 1704 in IBC search range 1702 for current block1708. The encoder may determine BV 1704, from a plurality of BVs, as theBV that points to a “best matching” reference block in IBC search range1702 for current block 1708.

The encoder may determine the best matching reference block in IBCsearch range 1702 based on a prediction error. The prediction error maybe calculated as a difference between values of the samples of referenceblock 1706 and current block 1708. This approach may prefer an exactmatch of values of the samples between reference block 1706 and currentblock 1708, as illustrated in FIG. 16 . If there is a difference betweenthe reference block and current block, then the corresponding samplevalues may not be the same. For example, as illustrated in FIG. 18 , thebest matching reference block for the current block containing theletters “he” includes the same letters but is in ‘italics’. Thestate-of-the-art IBC prediction process may fail to determine this bestmatching reference block. The geometrical transformation (ormodification) of the prediction samples of the reference block due tothe italicized format is not considered in the state-of-the-art IBCprediction process. And even if the encoder selects the reference blockillustrated in FIG. 18 , the corresponding residual determined based on,for example, a difference between the reference block and the currentblock may contain a high energy content because the reference block'sletters are italicized and the letters of the current block are notitalicized. The high energy contain may require more bits to be signaledin a bit stream.

Embodiments of the present disclosure are related to a method andapparatus for increasing compression efficiency of IBC. Embodiments ofthe present disclosure may determine an affine transform (or geometricaltransform) for prediction samples of a reference block determined for acurrent block using IBC. The affine transform may be applied on theprediction samples of the reference block such that the samples moreaccurately predict the current block. A residual may be calculated basedon a difference between the affine transformed prediction samples of thereference block and the current block. A more accurate predictiondecreases the size of the residual and increases IBC compressionefficiency. Embodiments of the present disclosure may signal, in a bitstream, an indication of the affine transform of the selected predictionsamples of the reference block and corresponding affine transformparameters. These and other features of the present disclosure aredescribed further below.

FIG. 19 illustrates an example of an affine transform performed by anencoder on prediction samples of a reference block in accordance withembodiments of the present disclosure. FIG. 19 illustrates the samecurrent frame as in FIG. 17 , including IBC search range 1702, BV 1704,reference block 1706, and current block 1708. FIG. 19 furtherillustrates an affine transformed reference block 1902. The encoder mayapply an affine transform on the prediction samples of reference block1706 to produce affine transformed reference block 1902. The encoder maydetermine reference block 1706 in IBC search range 1702 using an IBCprediction technique. For example, the IBC prediction technique may bethe IBC prediction technique used in HEVC, VVC, AV1, and/or the like.After determining reference block 1702, the encoder may apply an affinetransform on the samples of reference block 1702. The affine transformparameters may be selected from among a plurality of affine transformparameters used to generate an affine transformation of reference block1706 and a prediction error determined for each of the affinetransformations. The prediction error may be calculated as a difference(e.g., sum of squared differences (SSD), sum of absolute differences(SAD), and/or sum of absolute transformed differences (SATD)) betweenthe samples of reference block 1706 after the affine transform using aset of affine transform parameters and the original samples of currentblock 1708. The encoder may select affine parameters corresponding tothe lowest prediction.

An example relationship between samples of reference block 1702 and thesamples of affine transformed reference block 1902 is illustrated inFIG. 20 . The samples of reference block 1702 are shown in FIG. 20 as arectangle with vertices A, B, C, D (referred to as rectangle ABCD) andthe corresponding deformation of the rectangle due to the affinetransformation is shown in FIG. 20 as a rectangle with vertices A′, B′,C′, and D′ (referred to as rectangle A′B′C′D′). An affine transformationpreserves lines and parallelism. The rectangle ABCD may characterizerotation, scaling, shear mapping, and translation due to the affinetransformation to rectangle A′B′C′D′. An affine transformation, such asthe affine transformation of reference block 1702, may be described as

$\begin{matrix}\left\{ \begin{matrix}{\overset{'}{x} = {{ax} + {by} + c}} \\{\overset{'}{y} = {{dx} + {ey} + f}}\end{matrix} \right. & (14)\end{matrix}$where a, b, c, d, e, and f are six affine parameters and (x, y), ({acuteover (x)}, ý) are the coordinates of the same pixel before and after theaffine transform.

For video compression, to tradeoff computational complexity andcompression efficiency, a four-parameter affine model may be used fornatural scene. FIG. 21 illustrates an example of a four-parameter affinemodel with rotation, scaling, and translation applied to a current block2102 and the resulting affine transformed block 2104. The center ofcurrent block 2102 is (a,b). θ is an amount of rotation, v is an amountof translation, and p is an amount of scaling applied, which shifts thecenter to (á, {acute over (b)}) in affine transformed block 2104, asillustrated in FIG. 21 . A four-parameter affine transformation may bedescribed as

$\begin{matrix}\left\{ \begin{matrix}{\overset{'}{x} = {{\rho\mspace{14mu}\cos\mspace{14mu}{\theta \cdot x}} + {\rho\mspace{14mu}\sin\mspace{14mu}{\theta \cdot y}} + c}} \\{\overset{'}{y} = {{{- \rho}\mspace{14mu}\sin\mspace{14mu}{\theta \cdot x}} + {\rho\mspace{14mu}\cos\mspace{14mu}{\theta \cdot y}} + f}}\end{matrix} \right. & (15)\end{matrix}$where (x, y), ({acute over (x)}, ý) are the coordinates of a pixelbefore and after affine transform. Compared to the affine modeldescribed in (14), the affine parameters may be modeled as

$\begin{matrix}\left\{ \begin{matrix}{a = {{\rho\mspace{14mu}\cos\mspace{14mu}\theta} = e}} \\{b = {{\rho\mspace{14mu}\sin\mspace{14mu}\theta} = {- d}}}\end{matrix} \right. & (16)\end{matrix}$

In addition to the affine parameters, an indication of the affinetransform may be signaled in a bitstream to a decoder. This indicationmay be a flag (e.g., Affine_IBC_Flag) and a value corresponding to theflag may be set as illustrated in FIG. 22 . In FIG. 22 , IBC predictionis performed at 2202. During IBC prediction, a reference block isselected for predicting a current block being encoded. For example, areference block may be selected for predicting a current block asillustrated and discussed above with respect to FIG. 19 . The selectedreference block may have the same size as the current block. After 2202,affine parameters may be determined at 2206 for the selected reference.For example, the affine parameters may be determined for the selectedreference block as discussed above with respect to FIG. 19 and FIG. 20 .At 2206, the determined affine parameters may be checked. The determinedaffine parameters may be checked to determine if they have a value ofzero as shown in FIG. 22 , which indicates that the determined affineparameters provide no affine transformation and the reference blockafter being transform based on the determined affine parameters will bethe same as the reference block before the transformation. In such acase, the indication of affine transform signaled in the bitstream to adecoder (e.g., Affine_IBC_Flag) may be set to a value (e.g., ‘0’)indicating no affine transform is to be applied to reference block (orthat the affine parameters may be set to ‘0’). For non-zero affineparameters, the indication of affine transform signaled in the bitstreamto a decoder may be set to a value (e.g., ‘1’) indicating that affinetransform is to be applied to the reference block and that thecorresponding affine parameters may be separately signaled in thebitstream to the decoder. Irrespective of the condition in 2206, theindication may be sent to the decoder end.

The computational complexity for affine transform of a reference blockmay be reduced. For example, in FIG. 23 , a conditional computation ofthe affine transform may be based on the residual of the selectedreference block. In FIG. 23 , IBC prediction is performed at 2202 and aresulting residual of the reference block selected at 2220 is checked at2302. The residual of the selected IBC block is checked at 2302 beforedetermining affine transform parameters at 2204. If the residual of theselected IBC block is zero this indicates that the selected referenceblock is the same as the current block. In an example, there may be noneed to calculate affine parameters for the selected IBC block if theresidual is zero and the Affine_IBC_Flag may be set to ‘0’. For non-zeroresiduals, affine parameters are determined for the reference block and,based on the affine parameters, Affine_IBC_Flag is set. Irrespective ofthe condition in 2302, the indication may be sent to the decoder end.

In HEVC, VVC, and other video coding implementations, an encoder signalsinformation of a coded video sequence in a bitstream based on syntaxstructures, and a decoder extracts the information of a coded videosequence from a bitstream based on syntax structures. A syntax structurerepresents a logical entity of the information coded in the bitstream.These logical entities may include, for example, parameter sets, slices,and coding tree units. Within HEVC and VCC, the syntax structures arespecified by syntax tables that indicate variations of the syntaxstructures. Syntax structures may comprise syntax elements. Syntaxelements may occur as flags, values, one dimensional arrays, ormulti-dimensional arrays. For arrays, one or more indices may be used toreference a specific element within the array. The occurrence of asyntax element within a syntax structure may be conditional. Forexample, the occurrence of a syntax element may be conditional on thevalue of one or more other syntax elements or values determined duringthe decoding process. Table 1 below provides an example embodiment ofthe present disclosure in a syntax structure of VVC.

TABLE 1 Descriptor coding_unit( x0, y0, cbWidth, cbHeight, cqtDepth,treeType, modeType ) { chType = treeType = = DUAL_TREE_CHROMA? 1 : 0 if(slice_type != I | | sps_ibc_enabled_flag | | sps_palette_enabled_flag) {if( treeType != DUAL_TREE_CHROMA && !( ( ( cbWidth = = 4 && cbHeight = =4 ) | | modeType = = MODE_TYPE_INTRA ) && !sps_ibc_enabled_flag ) )cu_skip_flag[ x0 ][ y0 ] ae(v) if( cu_skip_flag[ x0 ][ y0 ] = = 0 &&slice_type != I && !( cbWidth = = 4 && cbHeight = = 4 ) && modeType = =MODE_TYPE_ALL ) pred_mode_flag ae(v) if( ( ( slice_type = = I &&cu_skip_flag[ x0 ][ y0 ] = =0 ) | | ( slice_type != I && ( CuPredMode[chType ][ x0 ][ y0 ] != MODE_INTRA | | ( cbWidth = = 4 && cbHeight = = 4&& cu_skip_flag[ x0 ][ y0 ] = = 0 ) ) ) ) && cbWidth <= 64 && cbHeight<= 64 && modeType != MODE_TYPE_INTER && sps_ibc_enabled_flag && treeType!= DUAL_TREE_CHROMA ) pred_mode_ibc_flag ae(v) if( ( ( ( slice_type = =I | | ( cbWidth = = 4 && cbHeight = = 4 ) | | sps_ibc_enabled_flag ) &&CuPredMode[ x0 ][ y0 ] = = MODE_INTRA ) | | ( slice_type != I && !(cbWidth = = 4 && cbHeight = = 4 ) && !sps_ibc_enabled_flag &&CuPredMode[ x0 ][ y0 ] != MODE_INTRA ) ) && sps_palette_enabled_flag &&cbWidth <= 64 && cbHeight <= 64 && && cu_skip_flag[ x0 ][ y0 ] = = 0 &&modeType != MODE_INTER ) pred_mode_plt_flag ae(v) } if( CuPredMode[chType ][ x0 ][ y0 ] = = MODE_INTRA | | CuPredMode[ chType ][ x0 ][ y0 ]= = MODE_PLT ) { if( treeType = = SINGLE_TREE | | treeType = =DUAL_TREE_LUMA ) { if( pred_mode_plt_flag ) { if( treeType = =DUAL_TREE_LUMA ) palette_coding( x0, y0, cbWidth, cbHeight, 0, 1 ) else/* SINGLE_TREE */ palette_coding( x0, y0, cbWidth, cbHeight, 0, 3 ) }else { if( sps_bdpcm_enabled_flag && cbWidth <= MaxTsSize && cbHeight <=MaxTsSize ) intra_bdpcm_flag ae(v) if( intra_bdpcm_flag )intra_bdpcm_dir_flag ae(v) else { if( sps_mip_enabled_flag && ( Abs(Log2( cbWidth ) − Log2( cbHeight ) ) <= 2 ) && cbWidth <= MaxTbSizeY &&cbHeight <= MaxTbSizeY ) intra_mip_flag[ x0 ][ y0 ] ae(v) if(intra_mip_flag[ x0 ][ y0 ] ) intra_mip_mode[ x0 ][ y0 ] ae(v) else { if(sps_mrl_enabled_flag && ( ( y0 % CtbSizeY ) > 0 ) ) intra_luma_ref_idx[x0 ][ y0 ] ae(v) if ( sps_isp_enabled_flag && intra_luma_ref_idx[ x0 ][y0 ] = = 0 && ( cbWidth <= MaxTbSizeY && cbHeight <= MaxTbSizeY ) && (cbWidth * cbHeight > MinTbSizeY * MinTbSizeY ) )intra_subpartitions_mode_flag[ x0 ][ y0 ] ae(v) if(intra_subpartitions_mode_flag[ x0 ][ y0 ] = = 1 )intra_subpartitions_split_flag[ x0 ][ y0 ] ae(v) if( intra_luma_ref_idx[x0 ][ y0 ] = = 0 ) intra_luma_mpm_flag[ x0 ][ y0 ] ae(v) if(intra_luma_mpm_flag[ x0 ][ y0 ] ) { if( intra_luma_ref_idx[ x0 ][ y0 ] == 0 ) intra_luma_not_planar_flag[ x0 ][ y0 ] ae(v) if(intra_luma_not_planar_flag[ x0 ][ y0 ] ) intra_luma_mpm_idx[ x0 ][ y0 ]ae(v) } else intra_luma_mpm_remainder[ x0 ][ y0 ] ae(v) } } } } if( (treeType = = SINGLE_TREE | | treeType = = DUAL_TREE_CHROMA ) &&ChromaArrayType != 0 ) { if ( pred_mode_plt_flag && treeType = =DUAL_TREE_CHROMA ) palette_coding( x0, y0, cbWidth / SubWidthC, cbHeight/ SubHeightC, 1, 2 ) else { if( CclmEnabled ) cclm_mode_flag ae(v) if(cclm_mode_flag ) cclm_mode_idx ae(v) else intra_chroma_pred_mode ae(v) }} } else if( treeType != DUAL_TREE_CHROMA ) { /* MODE_INTER or MODE_IBC*/ if( cu_skip_flag[ x0 ][ y0 ] = = 0 ) general_merge_flag[ x0 ][ y0 ]ae(v) if( general_merge_flag[ x0 ][ y0 ] ) { merge_data( x0, y0,cbWidth, cbHeight, chType ) } else if ( CuPredMode[ chType ][ x0 ][ y0 ]= = MODE_IBC ) { mvd_coding( x0, y0, 0, 0 ) if( MaxNumIbcMergeCand > 1 )mvp_l0_flag[ x0 ][ y0 ] ae(v) if( sps_amvr_endabled_flag && ( MvdL0[ x0][ y0 ][ 0 ] != 0 | | MvdL0[ x0 ][ y0 ][ 1 ] != 0 ) ) {amvr_precision_idx[ x0 ][ y0 ] ae(v) } } else { if( slice_type = = B )inter_pred_idc[ x0 ][ y0 ] ae(v) if( sps_affine_enabled_flag &&cbWidth >= 16 && cbHeight >= 16 ) { inter_affine_flag[ x0 ][ y0 ] ae(v)if( sps_affine_type_flag && inter_affine_flag [ x0 ][ y0 ] )cu_affine_type_flag[ x0 ][ y0 ] ae(v) } if( pred_mode_ibc_flag &&sps_affine_enabled_flag ) affine_ibc_flag[ x0 ][ y0 ] ae(v) if(sps_smvd_enabled_flag && !mvd_l1_zero_flag && inter_pred_idc[ x0 ][ y0 ]= = PRED_BI && !inter_affine_flag[ x0 ][ y0 ] && RefIdxSymL0 > −1 &&RefIdxSymL1 > −1 ) sym_mvd_flag[ x0 ][ y0 ] ae(v) if( inter_pred_idc[ x0][ y0 ] != PRED_L1 ) { if( NumRefIdxActive[ 0 ] > 1 && !sym_mvd_flag[ x0][ y0 ] ) ref_idx_l0[ x0 ][ y0 ] ae(v) mvd_coding( x0, y0, 0, 0 ) if(MotionModelIdc[ x0 ][ y0 ] > 0 ) mvd_coding( x0, y0, 0, 1 )if(MotionModelIdc[ x0 ][ y0 ] > 1 ) mvd_coding( x0, y0, 0, 2 )mvp_l0_flag[ x0 ][ y0 ] ae(v) } else { MvdL0[ x0 ][ y0 ][ 0 ] = 0 MvdL0[x0 ][ y0 ][ 1 ] = 0 } if( inter_pred_idc[ x0 ][ y0 ] != PRED_L0 ) { if(NumRefIdxActive[ 1 ] > 1 && !sym_mvd_flag[ x0 ][ y0 ] ) ref_idx_l1[ x0][ y0 ] ae(v) if( mvd_l1_zero_flag && inter_pred_idc[ x0 ][ y0 ] ==PRED_BI ) { MvdL1[ x0 ][ y0 ][ 0 ] = 0 MvdL1[ x0 ][ y0 ][ 1 ] = 0MvdCpL1[ x0 ][ y0 ][ 0 ][ 0 ] = 0 MvdCpL1[ x0 ][ y0 ][ 0 ][ 1 ] = 0MvdCpL1[ x0 ][ y0 ][ 1 ][ 0 ] = 0 MvdCpL1[ x0 ][ y0 ][ 1 ][ 1 ] = 0MvdCpL1[ x0 ][ y0 ][ 2 ][ 0 ] = 0 MvdCpL1[ x0 ][ y0 ][ 2 ][ 1 ] = 0 }else { if( sym_mvd_flag[ x0 ][ y0 ] ) { MvdL1[ x0 ][ y0 ][ 0 ] = −MvdL0[x0 ][ y0 ][ 0 ] MvdL1[ x0 ][ y0 ][ 1 ] = −MvdL0[ x0 ][ y0 ][ 1 ] } elsemvd_coding( x0, y0, 1, 0 ) if( MotionModelIdc[ x0 ][ y0 ] > 0 )mvd_coding( x0, y0, 1, 1 ) if(MotionModelIdc[ x0 ][ y0 ] > 1 )mvd_coding( x0, y0, 1, 2 ) mvp_l1_flag[ x0 ][ y0 ] ae(v) } } else {MvdL1[ x0 ][ y0 ][ 0 ] = 0 MvdL1[ x0 ][ y0 ][ 1 ] = 0 } if( (sps_amvr_enabled_flag && inter_affine_flag[ x0 ][ y0 ] = = 0 && ( MvdL0[x0 ][ y0 ][ 0 ] != 0 | | MvdL0[ x0 ][ y0 ][ 1 ] != 0 | | MvdL1[ x0 ][ y0][ 0 ] != 0 | | MvdL1[ x0 ][ y0 ][ 1 ] != 0 ) ) | |  (sps_affine_amvr_enabled_flag && (inter_affine_flag[ x0 ][ y0 ] = = 1 | | affine_ibc_flag[ x0 ][ y0 ] == 1) && ( MvdCpL0[ x0 ][ y0 ][ 0 ] [ 0 ]!= 0 | | MvdCpL0[ x0 ][ y0 ][ 0 ] [ 1 ] != 0 | | MvdCpL1[ x0 ][ y0 ][ 0] [ 0 ] != 0 | | MvdCpL1[ x0 ][ y0 ][ 0 ] [ 1 ] != 0 | | MvdCpL0[ x0 ][y0 ][ 1 ] [ 0 ] != 0 | | MvdCpL0[ x0 ][ y0 ][ 1 ] [ 1 ] != 0 | |MvdCpL1[ x0 ][ y0 ][ 1 ] [ 0 ] != 0 | | MvdCpL1[ x0 ][ y0 ][ 1 ] [ 1 ]!= 0 | | MvdCpL0[ x0 ][ y0 ][ 2 ] [ 0 ] != 0 | | MvdCpL0[ x0 ][ y0 ][ 2] [ 1 ] != 0 | | MvdCpL1[ x0 ][ y0 ][ 2 ] [ 0 ] != 0 | | MvdCpL1[ x0 ][y0 ][ 2 ] [ 1 ] != 0 ) ) { amvr_flag[ x0 ][ y0 ] ae(v) if( amvr_flag[ x0][ y0 ] ) amvr_precision_idx[ x0 ][ y0 ] ae(v) } if(sps_bcw_enabled_flag && inter_pred_idc[ x0 ][ y0 ] = = PRED_BI &&luma_weight_l0_flag[ ref_idx_l0 [ x0 ][ y0 ] ] = = 0 &&luma_weight_l1_flag[ ref_idx_l1 [ x0 ][ y0 ] ] = = 0 &&chroma_weight_l0_flag[ ref_idx_l0 [ x0 ][ y0 ] ] = = 0 &&chroma_weight_l1_flag[ ref_idx_l1 [ x0 ][ y0 ] ] = = 0 && cbWidth *cbHeight >= 256 ) bcw_idx[ x0 ][ y0 ] ae(v) } } if( CuPredMode[ chType][ x0 ][ y0 ] != MODE_INTRA && !pred_mode_plt_flag &&general_merge_flag[ x0 ][ y0 ] = = 0 ) cu_cbf ae(v) if( cu_cbf ) { if(CuPredMode[ chType ][ x0 ][ y0 ] = = MODE_INTER && sps_sbt_enabled_flag&& !ciip_flag[ x0 ][ y0 ] && !MergeTriangleFlag[ x0 ][ y0 ] ) { if(cbWidth <= MaxSbtSize && cbHeight <= MaxSbtSize ) { allowSbtVerH =cbWidth >= 8 allowSbtVerQ = cbWidth >= 16 allowSbtHorH = cbHeight >= 8allowSbtHorQ = cbHeight >= 16 if( allowSbtVerH | | allowSbtHorH ||  allowSbtVerQ | | allowSbtHorQ ) cu_sbt_flag ae(v) } if( cu_sbt_flag ){ if( ( allowSbtVerH | | allowSbtHorH ) && ( allowSbtVerQ | |allowSbtHorQ) ) cu_sbt_quad_flag ae(v) if( ( cu_sbt_quad_flag &&allowSbtVerQ && allowSbtHorQ ) | |  ( !cu_sbt_quad_flag && allowSbtVerH&& allowSbtHorH ) ) cu_sbt_horizontal_flag ae(v) cu_sbt_pos_flag ae(v) }} LfnstDcOnly = 1 LfnstZeroOutSigCoeffFlag = 1 transform_tree( x0, y0,cbWidth, cbHeight, treeType ) lfnstWidth = ( treeType = =DUAL_TREE_CHROMA ) ? cbWidth / SubWidthC : cbWidth lfnstHeight = (treeType = = DUAL_TREE_CHROMA ) ? cbHeight / SubHeightC : cbHeight if(Min( lfnstWidth, lfnstHeight ) >= 4 && sps_lfnst_enabled_flag = = 1 &&CuPredMode[ chType ][ x0 ][ y0 ] = = MODE_INTRA &&IntraSubPartitionsSplitType = = ISP_NO_SPLIT && ( !intra_mip_flag[ x0 ][y0 ] | | Min( lfnstWidth, lfnstHeight) >= 16 ) && tu_mts_idx[ x0 ][ y0 ]= = 0 && Max( cbWidth, cbHeight ) <= MaxTbSizeY) { if( LfnstDcOnly = = 0&& LfnstZeroOutSigCoeffFlag = = 1 ) lfnst_idx[ x0 ][ y0 ] ae(v) } }

FIG. 24 illustrates an example of an encoding process for affinerefinement-based IBC prediction. A current block of samples 2402 may beencoded as intra prediction or IBC prediction using current frame as thereference. The encoder may determine a selected intra prediction of thecurrent block of samples by a plurality of intra prediction modes. Theplurality of intra prediction modes may depend on video compressionstandards. For example, the encoder may predict the current block ofsamples 2402 for each of the 35 intra prediction modes in HEVC or 67intra prediction modes in VVC. For each intra prediction mode, 2406applied, the encoder may determine a prediction error for the currentblock of samples 2402 based on a difference (e.g., sum of squareddifferences (SSD), sum of absolute differences (SAD), and/or sum ofabsolute transformed differences (SATD)) between the prediction samplesdetermined for the intra prediction mode and the current block ofsamples 2402. The encoder may select an intra prediction mode 2404 fromthe intra prediction modes 2406 to encode the current block of samples2402 based on determined prediction errors. For example, the encoder mayselect an intra prediction mode that results in the smallest predictionerror for the current block of samples 2402. In an example, the encodermay select the intra prediction mode to encode the current block ofsamples 2402 based on a rate-distortion measure determined using theprediction errors. The encoder may send an indication of selected intraprediction mode 2404 and its corresponding prediction error to a decoderfor decoding of the current block of samples 2402.

FIG. 24 illustrates an example of IBC prediction for a current block ofsamples 2402. The encoder may determine the “best match” for the currentblock 2402 in an IBC search range 2410 in a current frame. The IBCsearch range of 2410 may depend on video compression standards. Theencoder may select IBC prediction block 2412 in the IBC search rangebased on determined prediction errors. For example, the encoder mayselect an IBC prediction block 2412 that results in the smallestprediction error for the current block of samples 2402. In an example,the encoder may select the IBC prediction block 2412 to encode thecurrent block of samples 2402 based on a rate-distortion measuredetermined using the prediction errors. For the selected reference blockfor IBC prediction 2412, the encoder may apply an affine transform 2414.From the plurality of affine parameters, selected affine parameter maybe chosen based on the prediction errors the same as the exampleillustrated in FIG. 19 .

FIG. 24 illustrates residuals 2408 of the prediction errors for intraprediction and IBC prediction, may be converted into a frequency domainsignal by applying a frequency domain transform and followed by aquantization (2416). The quantized signals for IBC prediction (2418) andintra prediction (2420) may be compared by the encoder and one of themmay be selected. The selection of the quantized signal (from 2418 and2420) may be based on a rate-distortion cost value. The selectedquantized signal may be transmitted to the bitstream (2424) afterentropy encoding (2422).

In an example embodiment, an encoder may generate, for each of aplurality of block vectors, an intra block compensated prediction of ablock. The encoder may select, based on the intra block compensatedpredictions of the block, a block vector from the plurality of blockvectors for the block.

The encoder may determine affine transform parameters of the intra blockcompensated prediction for the block vector. In an example, the encodermay determine an affine transformed intra block compensated predictionblock of samples based on the affine transform parameters. The encodermay calculate a residual for the affine transformed intra blockcompensated prediction block of samples based on the affine transformedintra block compensated prediction block of samples, and samples of theblock. The determining the affine transform parameter may be based on arate distortion optimization calculation.

The encoder may signal, in the bit stream, the residual. The encoder maysignal, in the bit stream, an indication of an affine transform of theintra block compensated prediction, and the affine transform parameters.In an example, the signaling may comprise signaling, in the bit stream,the indication of the affine transform, and/or the affine parametersaccording to a syntax structure. In an example, the encoder may signalof an indication of the subpixel level interpolation in the bit stream.The encoder may signal of an indication of the transforming luminancesamples and chrominance samples in the bit stream. An example, theencoder may signal of an indication of the transforming only one ofluminance samples or chrominance samples in the bit stream.

In an example, the indication of the affine transform in the syntaxstructure may be conditioned on the values of the affine transformparameters. In an example, the indication of the affine transform in thesyntax structure may be conditioned on residuals of the intra blockcompensated prediction. For example, the residuals may be calculatedbased on samples of the intra block compensated prediction of the block,and/or samples of the block. The affine transform parameters in thesyntax structure may be conditioned on the indication of the affinetransform. The encoder may be transformed luminance samples andchrominance samples of the intra block compensated prediction based onthe affine transform parameters. The encoder may transform only one ofluminance samples or chrominance samples of the intra block compensatedprediction based on the affine transform parameters.

In an example, precision of the affine transform parameters of the intrablock compensated prediction is at subpixel level interpolation. Thesubpixel level interpolation may comprise one of bicubic, bilinear, oraverage up-sampling of samples of the intra block compensated predictionblock.

An example of decoding of a bitstream 2424 is illustrated in FIG. 25 .FIG. 25 illustrates an entropy decoder 2502, inverse transform-quantizer2504, and corresponding decoded residual block 2506. The input bitstream2424 is decoded by an entropy decoder 2502 and the corresponding outputis applied to an inverse transform and followed by an inverse quantizer(2504). From the inverse quantized signal, a decoded residual block(2506) is generated. The indication of the affine transform(Affine_IBC_Flag), affine parameters, and BV, which may be embedded intothe encoded bitstream, is decoded by the decoder. Using the decoded BV,the IBC block is determined in a current frame and affine parameters areapplied on it (if the Affine_IBC_Flag is ‘1’) which may generate finaldecoded block 2510.

The affine transform on a selected prediction samples of a referenceblock may perform on pixel level as well as the sub-pixel level asillustrated in FIG. 26 . In FIG. 26 , an example of selected predictionsamples of a reference block (1706) in an IBC search range (1702) isaffine transformed in pixel-level 2602 and sub-pixel level 2604precisions. For pixel level precision (2602), the ({acute over (x)}, ý)values of the equation (15) may be calculated using exact pixel valuesin the location of (x, y). For sub-pixel level precision (2604), aninterpolated pixel values may be calculated using a bicubic, bilinear,and/or any other interpolation algorithm.

The affine transform on the selected IBC block may have luminance andchrominance components as illustrated in FIG. 27 . In FIG. 27 , anexample selected prediction samples of a reference block (1706) forluminance is 2706, and chrominances (Cr and Cb) are 2708 and 2710,respectively. On a selected prediction samples of a reference block(1706) in an IBC search range (1702), the affine transformation may beapplied separately on luminance and chrominance planes. Both pixel leveland sub-pixel level-based precision for the affine transformation mayapply on each plane. In an example, the encoder may not be restricted tothe same level of precision for luminance and chrominance planes. Forexample, FIG. 27 , illustrates pixel-level precision for luminance planeand sub-pixel level precision for chrominance planes.

In an example embodiment, a decoder may receive, from a bit stream for ablock, an indication of a block vector, a residual, and an indication ofan affine transform. Based on the indication of the affine transform,the decoder may receive an indication of affine transform parameters. Inan example the decoder may receive an indication of subpixel levelinterpolation of the affine transformation for the intra blockcompensated prediction from the bit stream. In an example the decodermay receive an indication of chrominance samples of the affinetransformation for the intra block compensated prediction from the bitstream. The decoder may decode the block based on the residual and theaffine transformation.

The decoder may generate an intra block compensated prediction of theblock based on the block vector. The decoder may determine an affinetransformation of the intra block compensated prediction based on theaffine transform parameters. In an example the affine transformation forthe intra block compensated prediction comprises subpixel levelinterpolation based on the indication of subpixel level interpolation.In an example of the subpixel level interpolation comprises one ofbicubic, bilinear, or average up-sampling of samples of the intra blockcompensated prediction. In an example the affine transformation for theintra block compensated prediction comprises chrominance samples basedon the indication of chrominance samples.

Embodiments of the present disclosure may be implemented in hardwareusing analog and/or digital circuits, in software, through the executionof instructions by one or more general purpose or special-purposeprocessors, or as a combination of hardware and software. Consequently,embodiments of the disclosure may be implemented in the environment of acomputer system or other processing system. An example of such acomputer system 2800 is shown in FIG. 28 . Blocks depicted in thefigures above, such as the blocks in FIGS. 1, 2, and 3 , may execute onone or more computer systems 2800. Furthermore, each of the steps of theflowcharts depicted in this disclosure may be implemented on one or morecomputer systems 2800.

Computer system 2800 includes one or more processors, such as processor2804. Processor 2804 may be, for example, a special purpose processor,general purpose processor, microprocessor, or digital signal processor.Processor 2804 may be connected to a communication infrastructure 902(for example, a bus or network). Computer system 2800 may also include amain memory 2806, such as random access memory (RAM), and may alsoinclude a secondary memory 2808.

Secondary memory 2808 may include, for example, a hard disk drive 2810and/or a removable storage drive 2812, representing a magnetic tapedrive, an optical disk drive, or the like. Removable storage drive 2812may read from and/or write to a removable storage unit 2816 in awell-known manner. Removable storage unit 2816 represents a magnetictape, optical disk, or the like, which is read by and written to byremovable storage drive 2812. As will be appreciated by persons skilledin the relevant art(s), removable storage unit 2816 includes a computerusable storage medium having stored therein computer software and/ordata.

In alternative implementations, secondary memory 2808 may include othersimilar means for allowing computer programs or other instructions to beloaded into computer system 2800. Such means may include, for example, aremovable storage unit 2818 and an interface 2814. Examples of suchmeans may include a program cartridge and cartridge interface (such asthat found in video game devices), a removable memory chip (such as anEPROM or PROM) and associated socket, a thumb drive and USB port, andother removable storage units 2818 and interfaces 2814 which allowsoftware and data to be transferred from removable storage unit 2818 tocomputer system 2800.

Computer system 2800 may also include a communications interface 2820.Communications interface 2820 allows software and data to be transferredbetween computer system 2800 and external devices. Examples ofcommunications interface 2820 may include a modem, a network interface(such as an Ethernet card), a communications port, etc. Software anddata transferred via communications interface 2820 are in the form ofsignals which may be electronic, electromagnetic, optical, or othersignals capable of being received by communications interface 2820.These signals are provided to communications interface 2820 via acommunications path 2822. Communications path 2822 carries signals andmay be implemented using wire or cable, fiber optics, a phone line, acellular phone link, an RF link, and other communications channels.

As used herein, the terms “computer program medium” and “computerreadable medium” are used to refer to tangible storage media, such asremovable storage units 2816 and 2818 or a hard disk installed in harddisk drive 2810. These computer program products are means for providingsoftware to computer system 2800. Computer programs (also calledcomputer control logic) may be stored in main memory 2806 and/orsecondary memory 2808. Computer programs may also be received viacommunications interface 2820. Such computer programs, when executed,enable the computer system 2800 to implement the present disclosure asdiscussed herein. In particular, the computer programs, when executed,enable processor 2804 to implement the processes of the presentdisclosure, such as any of the methods described herein. Accordingly,such computer programs represent controllers of the computer system2800.

In an embodiment, features of the disclosure may be implemented inhardware using, for example, hardware components such asapplication-specific integrated circuits (ASICs) and gate arrays.Implementation of a hardware state machine to perform the functionsdescribed herein will also be apparent to persons skilled in therelevant art(s).

What is claimed is:
 1. A method comprising: generating, for each of aplurality of block vectors, an intra block compensated prediction of acurrent block; selecting, based on the intra block compensatedpredictions of the current block, a block vector from the plurality ofblock vectors for the current block; determining a residual based on thecurrent block and the intra block compensated prediction generated forthe selected block vector; based on the residual indicating a non-zeroresidual value, determining affine transform parameters of the intrablock compensated prediction generated for the selected block vector;and signaling, in a bit stream, both of an indication of an affinetransform of the intra block compensated prediction and the affinetransform parameters based on: the residual; and a value of the affinetransform parameters.
 2. The method of claim 1, wherein the signalingcomprises signaling, in the bit stream, the indication of the affinetransform and the affine transform parameters according to a syntaxstructure.
 3. The method of claim 1, further comprising: determining anaffine transformation of the intra block compensated prediction based onthe affine transform parameters; calculating a residual for the affinetransformation of the intra block compensated prediction based on: theaffine transformation of the intra block compensated prediction; andsamples of the current block; and signaling, in the bit stream, theresidual for the affine transformation.
 4. The method of claim 1,wherein the determining the affine transform parameters is based on arate distortion calculation.
 5. The method of claim 1, wherein aprecision of the affine transform parameters is at a subpixel levelinterpolation.
 6. The method of claim 5, further comprising signaling anindication of the subpixel level interpolation in the bit stream.
 7. Themethod of claim 5, wherein the subpixel level interpolation comprisesone of bicubic, bilinear, or average up-sampling of samples of the intrablock compensated prediction of the current block.
 8. The method ofclaim 1, further comprising transforming luminance samples andchrominance samples of the intra block compensated prediction based onthe affine transform parameters.
 9. The method of claim 1, furthercomprising transforming only one of luminance samples or chrominancesamples of the intra block compensated prediction based on the affinetransform parameters.
 10. The method of claim 9, further comprisingsignaling an indication of the one of the luminance samples orchrominance samples in the bit stream.
 11. The method of claim 1,wherein the selecting, based on the intra block compensated predictionsof the current block, the block vector further comprises selecting theblock vector that corresponds to the intra block compensated predictionthat has a lowest difference of a plurality of differences between thesamples of the current block and the samples of each of the intra blockcompensated predictions.
 12. The method of claim 1, wherein the non-zeroresidual value indicates a non-exact match between the current block andthe intra block compensated prediction generated for the selected blockvector.
 13. The method of claim 1, further comprising, based on thevalue of the affine transform parameters, determining whether to skipsignaling the affine transform parameters in the bit stream.
 14. Amethod comprising: receiving, from a bit stream for a current block, anindication of a block vector, a residual, an indication of an affinetransform of an intra block compensated prediction, and affine transformparameters, wherein both the indication of the affine transform of theintra block compensated prediction and the affine transform parametersare received based on: the residual indicating a non-zero residualvalue; and a value of the affine transform parameters; generating theintra block compensated prediction of the current block based on theblock vector; determining an affine transformation of the intra blockcompensated prediction based on the affine transform parameters; anddecoding the current block based on the residual and the affinetransformation.
 15. The method of claim 14, further comprisingreceiving, from the bit stream, an indication of subpixel levelinterpolation for the affine transformation.
 16. The method of claim 15,wherein the determining the affine transformation of the intra blockcompensated prediction comprises subpixel level interpolation based onthe indication of subpixel level interpolation.
 17. The method of claim16, wherein the subpixel level interpolation comprises one of bicubic,bilinear, or average up-sampling of samples of the intra blockcompensated prediction.
 18. The method of claim 14, further comprisingreceiving, from the bit stream, an indication that the affinetransformation for the intra block compensated prediction is forchrominance samples.
 19. The method of claim 14, wherein the indicationof the affine transform and the affine transform parameters are receivedfrom the bit stream according to a syntax structure.
 20. The method ofclaim 14, wherein the non-zero residual value indicates a non-exactmatch between the current block and the intra block compensatedprediction generated for the block vector.